class P160 {
	public static void main(String[] args) {
		String[] array = new String[101];

		array[1] = "  1! =";
		array[2] = "  2! =  1";
		array[3] = "  3! =  1  1";
		array[4] = "  4! =  3  1";
		array[5] = "  5! =  3  1  1";
		array[6] = "  6! =  4  2  1";
		array[7] = "  7! =  4  2  1  1";
		array[8] = "  8! =  7  2  1  1";
		array[9] = "  9! =  7  4  1  1";
		array[10] = " 10! =  8  4  2  1";
		array[11] = " 11! =  8  4  2  1  1";
		array[12] = " 12! = 10  5  2  1  1";
		array[13] = " 13! = 10  5  2  1  1  1";
		array[14] = " 14! = 11  5  2  2  1  1";
		array[15] = " 15! = 11  6  3  2  1  1";
		array[16] = " 16! = 15  6  3  2  1  1";
		array[17] = " 17! = 15  6  3  2  1  1  1";
		array[18] = " 18! = 16  8  3  2  1  1  1";
		array[19] = " 19! = 16  8  3  2  1  1  1  1";
		array[20] = " 20! = 18  8  4  2  1  1  1  1";
		array[21] = " 21! = 18  9  4  3  1  1  1  1";
		array[22] = " 22! = 19  9  4  3  2  1  1  1";
		array[23] = " 23! = 19  9  4  3  2  1  1  1  1";
		array[24] = " 24! = 22 10  4  3  2  1  1  1  1";
		array[25] = " 25! = 22 10  6  3  2  1  1  1  1";
		array[26] = " 26! = 23 10  6  3  2  2  1  1  1";
		array[27] = " 27! = 23 13  6  3  2  2  1  1  1";
		array[28] = " 28! = 25 13  6  4  2  2  1  1  1";
		array[29] = " 29! = 25 13  6  4  2  2  1  1  1  1";
		array[30] = " 30! = 26 14  7  4  2  2  1  1  1  1";
		array[31] = " 31! = 26 14  7  4  2  2  1  1  1  1  1";
		array[32] = " 32! = 31 14  7  4  2  2  1  1  1  1  1";
		array[33] = " 33! = 31 15  7  4  3  2  1  1  1  1  1";
		array[34] = " 34! = 32 15  7  4  3  2  2  1  1  1  1";
		array[35] = " 35! = 32 15  8  5  3  2  2  1  1  1  1";
		array[36] = " 36! = 34 17  8  5  3  2  2  1  1  1  1";
		array[37] = " 37! = 34 17  8  5  3  2  2  1  1  1  1  1";
		array[38] = " 38! = 35 17  8  5  3  2  2  2  1  1  1  1";
		array[39] = " 39! = 35 18  8  5  3  3  2  2  1  1  1  1";
		array[40] = " 40! = 38 18  9  5  3  3  2  2  1  1  1  1";
		array[41] = " 41! = 38 18  9  5  3  3  2  2  1  1  1  1  1";
		array[42] = " 42! = 39 19  9  6  3  3  2  2  1  1  1  1  1";
		array[43] = " 43! = 39 19  9  6  3  3  2  2  1  1  1  1  1  1";
		array[44] = " 44! = 41 19  9  6  4  3  2  2  1  1  1  1  1  1";
		array[45] = " 45! = 41 21 10  6  4  3  2  2  1  1  1  1  1  1";
		array[46] = " 46! = 42 21 10  6  4  3  2  2  2  1  1  1  1  1";
		array[47] = " 47! = 42 21 10  6  4  3  2  2  2  1  1  1  1  1  1";
		array[48] = " 48! = 46 22 10  6  4  3  2  2  2  1  1  1  1  1  1";
		array[49] = " 49! = 46 22 10  8  4  3  2  2  2  1  1  1  1  1  1";
		array[50] = " 50! = 47 22 12  8  4  3  2  2  2  1  1  1  1  1  1";
		array[51] = " 51! = 47 23 12  8  4  3  3  2  2  1  1  1  1  1  1";
		array[52] = " 52! = 49 23 12  8  4  4  3  2  2  1  1  1  1  1  1";
		array[53] = " 53! = 49 23 12  8  4  4  3  2  2  1  1  1  1  1  1" + System.getProperty("line.separator") + "      "
				+ "  1";
		array[54] = " 54! = 50 26 12  8  4  4  3  2  2  1  1  1  1  1  1" + System.getProperty("line.separator") + "      "
				+ "  1";
		array[55] = " 55! = 50 26 13  8  5  4  3  2  2  1  1  1  1  1  1" + System.getProperty("line.separator") + "      "
				+ "  1";
		array[56] = " 56! = 53 26 13  9  5  4  3  2  2  1  1  1  1  1  1" + System.getProperty("line.separator") + "      "
				+ "  1";
		array[57] = " 57! = 53 27 13  9  5  4  3  3  2  1  1  1  1  1  1" + System.getProperty("line.separator") + "      "
				+ "  1";
		array[58] = " 58! = 54 27 13  9  5  4  3  3  2  2  1  1  1  1  1" + System.getProperty("line.separator") + "      "
				+ "  1";
		array[59] = " 59! = 54 27 13  9  5  4  3  3  2  2  1  1  1  1  1" + System.getProperty("line.separator") + "      "
				+ "  1  1";
		array[60] = " 60! = 56 28 14  9  5  4  3  3  2  2  1  1  1  1  1" + System.getProperty("line.separator") + "      "
				+ "  1  1";
		array[61] = " 61! = 56 28 14  9  5  4  3  3  2  2  1  1  1  1  1" + System.getProperty("line.separator") + "      "
				+ "  1  1  1";
		array[62] = " 62! = 57 28 14  9  5  4  3  3  2  2  2  1  1  1  1" + System.getProperty("line.separator") + "      "
				+ "  1  1  1";
		array[63] = " 63! = 57 30 14 10  5  4  3  3  2  2  2  1  1  1  1" + System.getProperty("line.separator") + "      "
				+ "  1  1  1";
		array[64] = " 64! = 63 30 14 10  5  4  3  3  2  2  2  1  1  1  1" + System.getProperty("line.separator") + "      "
				+ "  1  1  1";
		array[65] = " 65! = 63 30 15 10  5  5  3  3  2  2  2  1  1  1  1" + System.getProperty("line.separator") + "      "
				+ "  1  1  1";
		array[66] = " 66! = 64 31 15 10  6  5  3  3  2  2  2  1  1  1  1" + System.getProperty("line.separator") + "      "
				+ "  1  1  1";
		array[67] = " 67! = 64 31 15 10  6  5  3  3  2  2  2  1  1  1  1" + System.getProperty("line.separator") + "      "
				+ "  1  1  1  1";
		array[68] = " 68! = 66 31 15 10  6  5  4  3  2  2  2  1  1  1  1" + System.getProperty("line.separator") + "      "
				+ "  1  1  1  1";
		array[69] = " 69! = 66 32 15 10  6  5  4  3  3  2  2  1  1  1  1" + System.getProperty("line.separator") + "      "
				+ "  1  1  1  1";
		array[70] = " 70! = 67 32 16 11  6  5  4  3  3  2  2  1  1  1  1" + System.getProperty("line.separator") + "      "
				+ "  1  1  1  1";
		array[71] = " 71! = 67 32 16 11  6  5  4  3  3  2  2  1  1  1  1" + System.getProperty("line.separator") + "      "
				+ "  1  1  1  1  1";
		array[72] = " 72! = 70 34 16 11  6  5  4  3  3  2  2  1  1  1  1" + System.getProperty("line.separator") + "      "
				+ "  1  1  1  1  1";
		array[73] = " 73! = 70 34 16 11  6  5  4  3  3  2  2  1  1  1  1" + System.getProperty("line.separator") + "      "
				+ "  1  1  1  1  1  1";
		array[74] = " 74! = 71 34 16 11  6  5  4  3  3  2  2  2  1  1  1" + System.getProperty("line.separator") + "      "
				+ "  1  1  1  1  1  1";
		array[75] = " 75! = 71 35 18 11  6  5  4  3  3  2  2  2  1  1  1" + System.getProperty("line.separator") + "      "
				+ "  1  1  1  1  1  1";
		array[76] = " 76! = 73 35 18 11  6  5  4  4  3  2  2  2  1  1  1" + System.getProperty("line.separator") + "      "
				+ "  1  1  1  1  1  1";
		array[77] = " 77! = 73 35 18 12  7  5  4  4  3  2  2  2  1  1  1" + System.getProperty("line.separator") + "      "
				+ "  1  1  1  1  1  1";
		array[78] = " 78! = 74 36 18 12  7  6  4  4  3  2  2  2  1  1  1" + System.getProperty("line.separator") + "      "
				+ "  1  1  1  1  1  1";
		array[79] = " 79! = 74 36 18 12  7  6  4  4  3  2  2  2  1  1  1" + System.getProperty("line.separator") + "      "
				+ "  1  1  1  1  1  1  1";
		array[80] = " 80! = 78 36 19 12  7  6  4  4  3  2  2  2  1  1  1" + System.getProperty("line.separator") + "      "
				+ "  1  1  1  1  1  1  1";
		array[81] = " 81! = 78 40 19 12  7  6  4  4  3  2  2  2  1  1  1" + System.getProperty("line.separator") + "      "
				+ "  1  1  1  1  1  1  1";
		array[82] = " 82! = 79 40 19 12  7  6  4  4  3  2  2  2  2  1  1" + System.getProperty("line.separator") + "      "
				+ "  1  1  1  1  1  1  1";
		array[83] = " 83! = 79 40 19 12  7  6  4  4  3  2  2  2  2  1  1" + System.getProperty("line.separator") + "      "
				+ "  1  1  1  1  1  1  1  1";
		array[84] = " 84! = 81 41 19 13  7  6  4  4  3  2  2  2  2  1  1" + System.getProperty("line.separator") + "      "
				+ "  1  1  1  1  1  1  1  1";
		array[85] = " 85! = 81 41 20 13  7  6  5  4  3  2  2  2  2  1  1" + System.getProperty("line.separator") + "      "
				+ "  1  1  1  1  1  1  1  1";
		array[86] = " 86! = 82 41 20 13  7  6  5  4  3  2  2  2  2  2  1" + System.getProperty("line.separator") + "      "
				+ "  1  1  1  1  1  1  1  1";
		array[87] = " 87! = 82 42 20 13  7  6  5  4  3  3  2  2  2  2  1" + System.getProperty("line.separator") + "      "
				+ "  1  1  1  1  1  1  1  1";
		array[88] = " 88! = 85 42 20 13  8  6  5  4  3  3  2  2  2  2  1" + System.getProperty("line.separator") + "      "
				+ "  1  1  1  1  1  1  1  1";
		array[89] = " 89! = 85 42 20 13  8  6  5  4  3  3  2  2  2  2  1" + System.getProperty("line.separator") + "      "
				+ "  1  1  1  1  1  1  1  1  1";
		array[90] = " 90! = 86 44 21 13  8  6  5  4  3  3  2  2  2  2  1" + System.getProperty("line.separator") + "      "
				+ "  1  1  1  1  1  1  1  1  1";
		array[91] = " 91! = 86 44 21 14  8  7  5  4  3  3  2  2  2  2  1" + System.getProperty("line.separator") + "      "
				+ "  1  1  1  1  1  1  1  1  1";
		array[92] = " 92! = 88 44 21 14  8  7  5  4  4  3  2  2  2  2  1" + System.getProperty("line.separator") + "      "
				+ "  1  1  1  1  1  1  1  1  1";
		array[93] = " 93! = 88 45 21 14  8  7  5  4  4  3  3  2  2  2  1" + System.getProperty("line.separator") + "      "
				+ "  1  1  1  1  1  1  1  1  1";
		array[94] = " 94! = 89 45 21 14  8  7  5  4  4  3  3  2  2  2  2" + System.getProperty("line.separator") + "      "
				+ "  1  1  1  1  1  1  1  1  1";
		array[95] = " 95! = 89 45 22 14  8  7  5  5  4  3  3  2  2  2  2" + System.getProperty("line.separator") + "      "
				+ "  1  1  1  1  1  1  1  1  1";
		array[96] = " 96! = 94 46 22 14  8  7  5  5  4  3  3  2  2  2  2" + System.getProperty("line.separator") + "      "
				+ "  1  1  1  1  1  1  1  1  1";
		array[97] = " 97! = 94 46 22 14  8  7  5  5  4  3  3  2  2  2  2" + System.getProperty("line.separator") + "      "
				+ "  1  1  1  1  1  1  1  1  1  1";
		array[98] = " 98! = 95 46 22 16  8  7  5  5  4  3  3  2  2  2  2" + System.getProperty("line.separator") + "      "
				+ "  1  1  1  1  1  1  1  1  1  1";
		array[99] = " 99! = 95 48 22 16  9  7  5  5  4  3  3  2  2  2  2" + System.getProperty("line.separator") + "      "
				+ "  1  1  1  1  1  1  1  1  1  1";
		array[100] = "100! = 97 48 24 16  9  7  5  5  4  3  3  2  2  2  2" + System.getProperty("line.separator") + "      "
				+ "  1  1  1  1  1  1  1  1  1  1";
		
		String line = readLn();
		while (!"0".equals(line)) {
			System.out.println(array[Integer.parseInt(line)]);
			line = readLn();
		}
		
	}
	
	static String readLn() {
		String newLine = System.getProperty("line.separator");
		StringBuffer buffer = new StringBuffer();
		int car = -1;
		try {
			car = System.in.read();
			while ((car > 0) && (car != newLine.charAt(0))) {
				buffer.append((char) car);
				car = System.in.read();
			}
			if (car == newLine.charAt(0))
				System.in.skip(newLine.length() - 1);
		} catch (java.io.IOException e) {
			return (null);
		}
		if ((car < 0) && (buffer.length() == 0))
			return (null);
		return (buffer.toString()).trim();
	}
}